﻿// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

//客户端使用组合模式

var root = new Folder("C:");

var docs = new Folder("Documents");
docs.Add(new File("report.pdf", 2048));
docs.Add(new File("notes.txt", 1024));

var pics = new Folder("Pictures");
pics.Add(new File("photo.jpg", 5120));

root.Add(docs);
root.Add(pics);

// 统一操作！
Console.WriteLine($"总大小: {root.GetSize()} KB"); // 8192
root.Delete(); // 递归删除所有内容